<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P182 8.2.1 获取事件对象</title>
</head>

<body>
    <button id="btn">获取event对象</button>
    <script>
        var btn = document.getElementById('btn');
        btn.onclick = function (e) {
            var event = e || window.event;
            console.log(event);
        }
    </script>
    <a href="../首页/page08.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>